package com.kai.steering.data.service.entity.po;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.kai.steering.data.service.entity.domainObject.UserDO;
import com.kai.steering.data.service.entity.dto.UserQueryDTO;
import lombok.*;

import java.io.Serializable;

/**
 * <pre>
 * 用户
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "user")

public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 账号
     */
    @TableId(value = "user_id", type = IdType.ID_WORKER)

    private String userId;


    /**
     * 用户名
     */

    private String userName;


    /**
     * 密码
     */

    private String password;


    /**
     * 用户简介
     */

    private String introduce;


    /**
     * 用户生日期
     */

    private Date birthday;


    /**
     * 创建日期
     */

    private Date creationDatetime;


    /**
     * 用户电话
     */

    private String phone;


    /**
     * 用户地址
     */

    private String address;


    /**
     * 存在0删除1
     */

    private Integer usable;


    /**
     * 删除日期
     */

    private Date deleteDatetime;


    /**
     * 仓库id
     */

    private String warehouseId;


    public User(UserDO userDO) {
        this.userId=userDO.getUserId();
        this.userName=userDO.getUserName();
        this.password=userDO.getPassword();
        this.introduce=userDO.getIntroduce();
        this.birthday=userDO.getBirthday();
        this.creationDatetime=userDO.getCreationDatetime();
        this.phone=userDO.getPhone();
        this.address=userDO.getAddress();
        this.usable=userDO.getUsable();
        this.deleteDatetime=userDO.getDeleteDatetime();
        this.warehouseId=userDO.getWarehouseId();

    }
    public User(UserQueryDTO userQueryDTO) {
        this.userId=userQueryDTO.getUserId();
        this.userName=userQueryDTO.getUserName();
        this.password=userQueryDTO.getPassword();
        this.introduce=userQueryDTO.getIntroduce();
        this.birthday=userQueryDTO.getBirthday();
        this.phone=userQueryDTO.getPhone();
        this.address=userQueryDTO.getAddress();
    }
}
